<!doctype html>



  


<html class="theme-next muse use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Ubuntu," />





  <link rel="alternate" href="/atom.xml" title="iJasonY's Blog" type="application/atom+xml" />




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1" />






<meta name="description" content="昨天在自己的VPS上面捣鼓东西，却不小心把先前已经装好的Node环境给…给…搞坏了（ps:别问我是怎么搞玩坏的，因为我也想知道😂 ）那么问题来了，搞坏了肿么办。。。(画外音:笨啊，重装呀，重装不会吗？)  对吼，重装，自己作的妖，跪着也要把它弄好（膝盖君: 我招谁惹谁了😭 ），于是乎拿起键盘就是 敲 ~ 先安装下依赖要在绝大多数*nix系的系统中编译Node.js,只要确保系统中有C/C++编">
<meta name="keywords" content="Ubuntu">
<meta property="og:type" content="article">
<meta property="og:title" content="如何在Ubuntu 14.04下安装Node.js">
<meta property="og:url" content="http://blog.ijason.me/p/c918e033/index.html">
<meta property="og:site_name" content="iJasonY&#39;s Blog">
<meta property="og:description" content="昨天在自己的VPS上面捣鼓东西，却不小心把先前已经装好的Node环境给…给…搞坏了（ps:别问我是怎么搞玩坏的，因为我也想知道😂 ）那么问题来了，搞坏了肿么办。。。(画外音:笨啊，重装呀，重装不会吗？)  对吼，重装，自己作的妖，跪着也要把它弄好（膝盖君: 我招谁惹谁了😭 ），于是乎拿起键盘就是 敲 ~ 先安装下依赖要在绝大多数*nix系的系统中编译Node.js,只要确保系统中有C/C++编">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2018-04-03T02:36:52.404Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="如何在Ubuntu 14.04下安装Node.js">
<meta name="twitter:description" content="昨天在自己的VPS上面捣鼓东西，却不小心把先前已经装好的Node环境给…给…搞坏了（ps:别问我是怎么搞玩坏的，因为我也想知道😂 ）那么问题来了，搞坏了肿么办。。。(画外音:笨啊，重装呀，重装不会吗？)  对吼，重装，自己作的妖，跪着也要把它弄好（膝盖君: 我招谁惹谁了😭 ），于是乎拿起键盘就是 敲 ~ 先安装下依赖要在绝大多数*nix系的系统中编译Node.js,只要确保系统中有C/C++编">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Muse',
    sidebar: {"position":"right","display":"always"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: undefined,
      author: '博主'
    }
  };
</script>

  <title> 如何在Ubuntu 14.04下安装Node.js | iJasonY's Blog </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  



  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?38c50d16a01b26734069c6e688d887c2";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>








  
  
    
  

  <div class="container one-collumn sidebar-position-right page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">iJasonY's Blog</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">繁花在時光中凋零，在記憶中盛開。</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                如何在Ubuntu 14.04下安装Node.js
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">发表于</span>
            <time itemprop="dateCreated" datetime="2016-11-28T18:23:20+08:00" content="2016-11-28">
              2016-11-28
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/随记/" itemprop="url" rel="index">
                    <span itemprop="name">随记</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
          

          

          
          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>昨天在自己的VPS上面捣鼓东西，却不小心把先前已经装好的Node环境给…给…搞坏了（ps:别问我是怎么搞玩坏的，因为我也想知道😂 ）那么问题来了，搞坏了肿么办。。。(画外音:笨啊，重装呀，重装不会吗？) </p>
<p>对吼，重装，自己作的妖，跪着也要把它弄好（膝盖君: 我招谁惹谁了😭 ），于是乎拿起键盘就是 敲 ~</p>
<h3 id="先安装下依赖"><a href="#先安装下依赖" class="headerlink" title="先安装下依赖"></a>先安装下依赖</h3><p>要在绝大多数*nix系的系统中编译Node.js,只要确保系统中有C/C++编译器以及OpenSSL库就可以了，如果没有安装起来也是比较容易的，在Ubuntu下只需执行以下命令就可以很方便的安装<br><a id="more"></a></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install g++ libssl-dev apache2-utils curl</span><br></pre></td></tr></table></figure>
<h3 id="然后下载Node-js源码到本地并解压缩"><a href="#然后下载Node-js源码到本地并解压缩" class="headerlink" title="然后下载Node.js源码到本地并解压缩"></a>然后下载Node.js源码到本地并解压缩</h3><p>ok 安装完依赖接下来我们再下载安装Node.js 源码包 (ps: 我这里安装的是V0.10.24版,大家可以自己选择所需的版本)</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">curl -O http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz</span><br><span class="line">tar -xzvf node-v0.10.24.tar.gz</span><br></pre></td></tr></table></figure>
<h3 id="进入到解压缩的目录进行编译和安装"><a href="#进入到解压缩的目录进行编译和安装" class="headerlink" title="进入到解压缩的目录进行编译和安装"></a>进入到解压缩的目录进行编译和安装</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">cd node-v0.10.24 </span><br><span class="line">./configure</span><br><span class="line">make</span><br><span class="line">make test </span><br><span class="line">make install</span><br></pre></td></tr></table></figure>
<h3 id="最后再确保下安装是否成功"><a href="#最后再确保下安装是否成功" class="headerlink" title="最后再确保下安装是否成功"></a>最后再确保下安装是否成功</h3><p>在系统终端下输入并执行</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">node -v</span><br></pre></td></tr></table></figure>
<p>如果安装成功的话就会显示当前安装的Node.js的版本号</p>
<p>OK, 打完收工！！！（膝盖君: 谢天谢地，终于好了😒 ）</p>
<p>怎么样是不是挺简单的哈</p>
<h3 id="后记"><a href="#后记" class="headerlink" title="后记"></a>后记</h3><p>据说还有个更方便的安装方式，就是用apt-get命令安装，不过我没实际操作过，大家可以试下，具体命令如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo apt-get install nodejs</span><br><span class="line">sudo apt-get install npm</span><br></pre></td></tr></table></figure>

      
    </div>

    <div>
      
        
      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Ubuntu/" rel="tag">#Ubuntu</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/p/c47aa1c0/" rel="next" title="加密算法简介">
                <i class="fa fa-chevron-left"></i> 加密算法简介
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/p/98bf8440/" rel="prev" title="git 的 .gitignore 配置">
                git 的 .gitignore 配置 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.png"
               alt="iJasonY" />
          <p class="site-author-name" itemprop="name">iJasonY</p>
          <p class="site-description motion-element" itemprop="description">繁花在時光中凋零，在記憶中盛開。</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">6</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              
                <span class="site-state-item-count">2</span>
                <span class="site-state-item-name">分类</span>
              
            </div>
          

          
            <div class="site-state-item site-state-tags">
              
                <span class="site-state-item-count">6</span>
                <span class="site-state-item-name">标签</span>
              
            </div>
          

        </nav>

        
          <div class="feed-link motion-element">
            <a href="/atom.xml" rel="alternate">
              <i class="fa fa-rss"></i>
              RSS
            </a>
          </div>
        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/iJasonY" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://weibo.com/JaosnYan" target="_blank" title="Weibo">
                  
                    <i class="fa fa-fw fa-weibo"></i>
                  
                  Weibo
                </a>
              </span>
            
          
        </div>

        
        

        
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#先安装下依赖"><span class="nav-number">1.</span> <span class="nav-text">先安装下依赖</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#然后下载Node-js源码到本地并解压缩"><span class="nav-number">2.</span> <span class="nav-text">然后下载Node.js源码到本地并解压缩</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#进入到解压缩的目录进行编译和安装"><span class="nav-number">3.</span> <span class="nav-text">进入到解压缩的目录进行编译和安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#最后再确保下安装是否成功"><span class="nav-number">4.</span> <span class="nav-text">最后再确保下安装是否成功</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#后记"><span class="nav-number">5.</span> <span class="nav-text">后记</span></a></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">iJasonY</span>
</div>

<div class="powered-by">
  由 <a class="theme-link" href="http://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>  
</div>

<div class="powered-by">
</div>
<div class="theme-info">
  <a class="theme-link" href="http://www.miibeian.gov.cn">闽ICP备15005530-2</a>
</div>

        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.1"></script>



  



  



  
  
  

  

  

</body>
</html>
